﻿@model IEnumerable<ecommerce2011.Models.CartItem>

@{
    ViewBag.Title = "Carrito";
}

<h2>Carrito de Compras</h2>
@{
    var totalOrden = (Decimal)ViewData["TotalOrden"];
}
<table>
    <tr>
        <th>
            Referencia
        </th>
        <th>
            Nombre
        </th>
        <th>
            Cantidad
        </th>
        <th>
            Precio Unitario
        </th>
        <th>
            Subtotal
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ProductId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Quantity)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UnitPrice)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TotalPrice)
        </td>
        <td>
            @Html.ActionLink("Cambiar Cantidad", "Edit", new {  id=item.ProductId  })
        </td>
    </tr>
}
<tr>
    <td colspan="4">
        <strong>TOTAL: </strong>
    </td>
    <td>
        $@totalOrden
    </td>
    <td></td>
</tr>

</table>
@using (Html.BeginForm("ConfirmProcessOrder", "CartItem", FormMethod.Post))
{ 
    <input type="submit" value="Procesar Orden" /><br />
}